﻿CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
PROJECT(NFMMOResStore)

AUX_SOURCE_DIRECTORY(DescStore SRC)
AUX_SOURCE_DIRECTORY(DescStoreEx SRC)
AUX_SOURCE_DIRECTORY(ResMetaS SRC)

if (CMAKE_BUILD_TYPE STREQUAL "Release")

	ADD_LIBRARY( ${PROJECT_NAME} STATIC ${SRC} )
elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")

	ADD_LIBRARY( ${PROJECT_NAME} STATIC ${SRC} )
elseif (CMAKE_BUILD_TYPE STREQUAL "DynamicRelease")

	ADD_LIBRARY( ${PROJECT_NAME} SHARED ${SRC} )
	TARGET_LINK_LIBRARIES(${PROJECT_NAME} NFMMOLogicMessage)
elseif(CMAKE_BUILD_TYPE STREQUAL "DynamicDebug")

	ADD_LIBRARY( ${PROJECT_NAME} SHARED ${SRC} )
	TARGET_LINK_LIBRARIES(${PROJECT_NAME} NFMMOLogicMessage)
endif()

# ============================================================================
# Install 配置
# ============================================================================
# 只有动态库版本才需要安装
if (CMAKE_BUILD_TYPE STREQUAL "DynamicRelease")
    install(TARGETS ${PROJECT_NAME}
            LIBRARY DESTINATION "Bin/DynamicRelease"
            RUNTIME DESTINATION "Bin/DynamicRelease"
            ARCHIVE DESTINATION "Bin/DynamicRelease")
elseif(CMAKE_BUILD_TYPE STREQUAL "DynamicDebug")
    install(TARGETS ${PROJECT_NAME}
            LIBRARY DESTINATION "Bin/DynamicDebug"
            RUNTIME DESTINATION "Bin/DynamicDebug"
            ARCHIVE DESTINATION "Bin/DynamicDebug")
endif()

